package cn.melon.mod.sc;

import java.util.List;

import org.junit.Test;

public class ScDaoTeat {

    
    @Test
    public void test() {
        ScDaoTest();
        StDaoTest();
    }
    
    public void ScDaoTest() {
        IScDaolmpl scDaolmpl = new IScDaolmpl();
        ScInfo info = new ScInfo();
        info.setClassName("微型机系统与接口技术");
        info.setClassNumber("2");
        info.setClassroom("九龙湖教四-104");
        info.setClassTeacher("杨全胜");
        info.setClassTerm("16-17-2");
        info.setClassTime("星期四-1-2");

        //scDaolmpl.addInfo(info);
        
        //scDaolmpl.deleteInfo("2");
        
        List<ScInfo> infoList = scDaolmpl.getAllScInfo();
        for(ScInfo tmpInfo : infoList) {
            System.out.println(tmpInfo.getClassName());
        }
//        scDaolmpl.onCreate();
        
    }
    
    public void StDaoTest() {
        IStDaolmpl stDaolmpl = new IStDaolmpl();
        stDaolmpl.addMessage("3", "09014311");
        stDaolmpl.addMessage("2", "09014311");
        stDaolmpl.deleteMessage("3", "09014311");
        
        StInfo info = new StInfo();
        info.setStudentNumber("09014315");
        info.setClassTable("[\"2\", \"3\", \"4\"]");        // 只是测试使用, 正式使用直接用JSONArray转字符串即可
        stDaolmpl.addOneStudent(info);
        stDaolmpl.deleteMessage("2", "09014315");
        //stDaolmpl.deleteOneStudent("09014315");
        //stDaolmpl.onCreate();
        
//        List<ScInfo> scInfoList = stDaolmpl.getAllInfo("09014311");
//        for(ScInfo info : scInfoList) {
//            System.out.println(info.getClassTeacher());
//        }
    }
}
